<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //1. 获取函数所有的实参和部分实参，可以替换arguments
        function test(...args){
            console.log(args)
        }
        test(10,23,45)

        function test(a,...args){
            console.log(a)
            console.log(args)
        }
        test(12,34,64)

        //2、合并对象或数组
        let obj2 ={name:'hanhan'}
        let obj3 = {...obj2,age:12}
        let obj4 = {...obj2,...obj3}
        console.log(obj4)
        console.log(obj3)

        //3.合并数组
        let arr=[1,2]
        let arr2 =[3,5]
        let arr3 = [...arr,...arr2]
        console.log(arr3)
        
    </script>
</body>
</html>